﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;

using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

using System.Collections.Specialized;

public partial class UserControls_ProductsList : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        PopulateControls();

    }
    private void PopulateControls()
    {
     //   // Retrieve DepartmentID from the query string
      //  string ID_TL = Request.QueryString["CDSID"];
        // Retrieve CategoryID from the query string
      //  string ID_SACH = Request.QueryString["ID_SACH"];
        // Retrieve Page from the query string
        // tim kiem
        string page = Request.QueryString["Page"];
        if (page == null) page = "1";
        // How many pages of products?
        int howManyPages = 1;

        // Retrieve Search string from query string
        string searchString = Request.QueryString["Search"];
        // How many pages of products?
        // If performing a product search
        if (searchString != null)
        {
            // Retrieve AllWords from query string
            string allWords = Request.QueryString["AllWords"];
            // Perform search
            list.DataSource = CatalogAccess.Search(searchString, allWords, page, out howManyPages);
            list.DataBind();
        }


    }
}
